/*
  CO & OA REVIVE SCRIPT

  © OCTOBER 2010 - norrin (simonnsl@iprimus.com.au)

  Version:  0.50 ArmA2	
*******************************************************************************************************
  See release notes for details on contributors and instructions for incorporating revive scripts into your  own missions
************************************************************************************
 Start revive_init.sqf
*/
// =====================================================================================================================
// DO NOT MODIFY THIS CODE
// =====================================================================================================================
// sickboy's code modified by _xeno
T_INIT 	= false;
T_Server 	= false; 
T_Client 	= false; 
T_JIP 	= false;

T_MP = (if (playersNumber east + playersNumber west + playersNumber resistance + playersNumber civilian > 0) then {true} else {false});

if (isServer) then 
{
	T_Server = true;
	if (!isNull player) then {T_Client = true};
	T_INIT = true;
} else {
	T_Client = true;
	if (isNull player) then 
	{
		T_JIP = true;
		[] spawn {waitUntil {!isNull player};T_INIT = true};
	} else {
		T_INIT = true;
	};
};
waitUntil {T_INIT};
// =====================================================================================================================
// THE FOLLOWING CODE CAN BE MODIFIED
// =====================================================================================================================
// GENERAL REVIVE OPTIONS  (Off = 0, On = 1)
_mission_end_function 			= 0;				//array no.0  - mission ends when all players are unconscious
_call_out_function 				= 1;				//array no.6  - whether a unit calls out while unconscious
_water_dialog 					= 1;				//array no.45 - whether a dialog appears when a unit dies in water so that it can auto wash ashore 
_unconscious_drag 				= 1;				//array no.39 - whether a unit can drag the bodies of unconscious players 
_load_wounded					= 1;				//array no.61 - allows you to load unconscious units on vehicles
_altUnc_animation 				= 0;				//array no.54 - use alternate revive animation
_JIP_spawn_dialog 				= 0;				//array no.2  - whether a dialog appears when a player JIP so that he can be transported to a spawn point near the action 
_time_b4_JIP_spawn_dialog 		= 10000;			//array no.17 - time before the respawn dialog appears for JIP players 
if (isnil "norrn_revive_jipdialogtime") then { norrn_revive_jipdialogtime = 0 };
if (isnil "norrn_revive_jipdialog") then { norrn_revive_jipdialog = false };
if (norrn_revive_jipdialog) then {
	_JIP_spawn_dialog 				= 1;				//array no.2  - whether a dialog appears when a player JIP so that he can be transported to a spawn point near the action 
	_time_b4_JIP_spawn_dialog 		= norrn_revive_jipdialogtime;			//array no.17 - time before the respawn dialog appears for JIP players 
};
_perpetual_server				= 0;				//array no.62 - NOT IMPLEMENTED
_ACE_mod						= 0;				//array no.102 - NOT IMPLEMENTED - Currently a place holder for possible future functionality 
// ==================================================================
// LIST OF PLAYABLE UNITS
NORRN_player_units = [];
{
	_var_name = vehicleVarName _x;
	if (_var_name == "") then {
		_var_name = Format["NORNN_PLAYER_UNIT_%1",count NORRN_player_units];
		missionNamespace setVariable [_var_name,_x];
		_x setVehicleVarName _var_name;
	};
	call compile format["NORRN_player_units set [count NORRN_player_units, %1];",_var_name];
} foreach (call XfPlayableUnits);
diag_log format["NORRN_player_units:%1",NORRN_player_units];
// ==================================================================
// WELCOME SCREEN
//titleText ["Joining the Revive Test Mission\n\n(Make sure you check the mission notes for details on how the scripts work\nand the revive_readMe in the attached pdf file for the full notes on implementing \nthe scripts in your own missions and the options available)", "BLACK FADED", 0.6]; 	// This next line can be commented out or removed if it interferes with intro movies  
// ==================================================================
// REVIVE OPTIONS
if (isnil "norrn_revive_max") then { norrn_revive_max = 1000 };
_max_respawns 					= norrn_revive_max;			//array no.38 - Number of lives per unit
_JIP_respawns					= [0,30];			//array no.63 - 0 - off or the number of lives players receive when they join in progress , JIP time after the mission starts 
_revive_timer 					= 0;	 			//array no.7  - Whether you want to limit the amount of timer a player has while unconscious
_revive_time_limit 				= 10000;				//array no.27 - Amount of time a player remains unconscious before respawning or dying
if (isnil "norrn_revive_timer") then { norrn_revive_timer = 5 };
if (norrn_revive_timer > 0) then {
	_revive_timer 					= 1;	 			//array no.7  - Whether you want to limit the amount of timer a player has while unconscious
	_revive_time_limit 				= norrn_revive_timer;				//array no.27 - Amount of time a player remains unconscious before respawning or dying
};
if (isnil "norrn_revive_damage") then { norrn_revive_damage = 0 };
_revive_damage 					= norrn_revive_damage;				//array no.37 - Unit's level of damage following revive
_unconscious_markers 			= 1;				//array no. 4 - Whether a marker appears on the game map at the location of the unconscious unit
_caseVAC						= [1, ["MASH","HMMWV_Base","UH1_Base","CH47_base_EP1","UH1H_base","Mi17_base","UH60_Base"]];	//array no.64 - Allows units to be taken to a hospital etc to be revived
_mediVAC						= [];				//array no.65 - NOT IMPLEMENTED
_chance_ofDeath					= [0,0];			//array no.66 - Two parameters in the array the first switches off/on (0/1) chance of death when shot, increases dues to hit location and number of times revived and the second parameter switches on/off the decreasing respawn timer based on how many times you have been revived, if using set respawn-time to at least 300 seconds.
_dualTimer						= 0;				//array no.67 - NOT IMPLEMENTED - normal units can only revive for eg 30 seconds whereas medics can heal players up to 120 secs - array - [0/1 - off/on, revive timer for normal unit, timer for medic] 
_deadSpectator_cam 				= 1;				//array no.92 - leave as 0 - whether a unit can spectate other friendly units when it has run out of lives
// ==================================================================
// RESPAWN OPTIONS
_with_mobile_respawn = false;
if (!isnil "r_mobile_spawn_vcl") then {
	if (!isnull r_mobile_spawn_vcl) then {
		if (isnil "with_mobile_respawn") then { with_mobile_respawn = 1; };
		_with_mobile_respawn = (with_mobile_respawn > 0);
		diag_log Format["(%1)[%2]: %3: %4",diag_tickTime,"revive_init.sqf","With Mobile Respawn",[(with_mobile_respawn > 0), r_mobile_spawn_vcl, typeof r_mobile_spawn_vcl]];
	};
};
_no_respawn_points 				= 2;				//array no.12 - no of respawn points (Max number 4)  
_Base_1 						= "Start";			//array no.13 - spawn position names  
_Base_2 						= "Respawn";			//array no.14
_Base_3 						= "";				//array no.15
_Base_4 						= "";				//array no.16 
if (_with_mobile_respawn) then {
	_no_respawn_points 				= 3;				//array no.12 - no of respawn points (Max number 4)  
	_Base_1 						= "Mobile";			//array no.13 - spawn position names  
	_Base_2 						= "Start";			//array no.14
	_Base_3 						= "Respawn";				//array no.15
	_Base_4 						= "";				//array no.16 
};
_Base_free_respawn 				= [1,1,1,0];		//array no.36 - select whether to allow respawning at spawn points even if enemy troops are present (options OFF = 0, ON = 1) 
if (isnil "norrn_revive_baseweapons") then { norrn_revive_baseweapons = 0 };
_respawn_at_base_addWeapons 	= norrn_revive_baseweapons;				//array no.11 - unit respawns with weapons it commenced the mission with  
_respawn_at_base_magazines 		= [];				//array no.34 - If using the respawn_at_base_addWeapons option then place the magazine and weapon 
_respawn_at_base_weapons 		= [];				//array no.35   types in the following arrays, if left blank respawns with weapons from mission start
_respawn_position 				= 2;				//array no.28 - 0 - respawn at base_1; 1 -  the closest enemy free respawn point; 2 - players choice; and 3 -  dies
_respawnAtBaseWait				= [0,0];			//array no.68 - Two parameters: 1st if = 1 makes players that respawn at base wait for (parameter 2) seconds before being able to see surroundings   
_objectiveBasedRP				= []; 				//array no.69 - NOT IMPLEMENTED
// Mobile Spawn Settings
_mobile_spawn 					= 0;				//array no.51 - set to 1 if you want to use mobile spawn	
//_mobile_base_start 				= "Insertion";			//array no.52 - NO LONGER NEEDED, REDUNDANT VARIABLE
_mobile_base2_start 			= "";				//array no.70 - NOT IMPLEMENTED
_mobile_type 					= 0;				//array no.60 - set as 0 - for vehicle and 1 for man
_mobile_man 					= objNull;  				//array no.53 - place name of unit here or if not used make sure set as objNull
_mobile_man2					= objNull;			//array no.71 - NOT IMPLEMENTED
if (_with_mobile_respawn) then {
	_mobile_spawn 					= 1;				//array no.51 - set to 1 if you want to use mobile spawn	
	//_mobile_base_start 				= "Insertion";			//array no.52 - NO LONGER NEEDED, REDUNDANT VARIABLE
	_mobile_base2_start 			= "";				//array no.70 - NOT IMPLEMENTED
	_mobile_type 					= 0;				//array no.60 - set as 0 - for vehicle and 1 for man
	if (r_mobile_spawn_vcl isKindOf "Man") then {
		_mobile_type 					= 1;				//array no.60 - set as 0 - for vehicle and 1 for man
		_mobile_man 					= r_mobile_spawn_vcl;  				//array no.53 - place name of unit here or if not used make sure set as objNull
	} else {	
		r_mobile_spawn_vcl addEventHandler ["GETIN",{diag_log format["GetIn: %1",_this]; if ((_this select 1) == "driver") then {["STR_MOBILE_HQ","unit",_this select 2,"global"] call XfHandleMessage;  NORRN_landy_script = [_this select 0, _this select 2] execVM "base\support\modules\norrn_revive\mobile\mobile_spawn.sqf"}}];
		r_mobile_spawn_vcl addEventHandler ["GETOUT",{diag_log format["GetOut: %1",_this]; [_this select 0] execVM "base\support\modules\norrn_revive\mobile\mobile_remove_spawn.sqf"}]; 
		[r_mobile_spawn_vcl, 30] execVM "base\support\modules\norrn_revive\mobile\vcl_respawn.sqf";
	};
};
// ==================================================================
// UNITS THAT CAN REVIVE/UNITS THAT CAN BE REVIVED
_can_revive 					= "soldierWB";		//array no.18 
_can_revive_2 					= "";				//array no.19
_can_revive_3					= "";				//array no.72 - NOT IMPLEMENTED
_can_revive_4					= "";				//array no.73 - NOT IMPLEMENTED
_can_be_revived 				= "soldierWB";		//array no.20  
_can_be_revived_2 				= "";				//array no.21 
_can_be_revived_3				= "";				//array no.74 - NOT IMPLEMENTED 
_can_be_revived_4 				= "";				//array no.75 - NOT IMPLEMENTED
_medic_1						= "B_medic_F";	//array no.76 - Used in conjunction with medpacks and bleeding	
_medic_2						= "";				//array no.77 - Used in conjunction with medpacks and bleeding
_medic_3						= "";				//array no.78 - NOT IMPLEMENTED	
_medic_4						= "";				//array no.79 - NOT IMPLEMENTED	
if ((west getFriend resistance) >= 0.6) then {
	_can_revive_2 					= "soldierGB";				//array no.19
	_can_be_revived_2 				= "soldierGB";				//array no.21 
};
switch (d_own_side) do {
	case "EAST":{
		_can_revive 					= "soldierEB";		//array no.18 
		_can_revive_2 					= "";				//array no.19
		_can_revive_3					= "";				//array no.72 - NOT IMPLEMENTED
		_can_revive_4					= "";				//array no.73 - NOT IMPLEMENTED
		_can_be_revived 				= "soldierEB";		//array no.20  
		_can_be_revived_2 				= "";				//array no.21 
		_can_be_revived_3				= "";				//array no.74 - NOT IMPLEMENTED 
		_can_be_revived_4 				= "";				//array no.75 - NOT IMPLEMENTED
		_medic_1						= "O_medic_F";	//array no.76 - Used in conjunction with medpacks and bleeding	
		_medic_2						= "";				//array no.77 - Used in conjunction with medpacks and bleeding
		_medic_3						= "";				//array no.78 - NOT IMPLEMENTED	
		_medic_4						= "";				//array no.79 - NOT IMPLEMENTED	
		if ((east getFriend resistance) >= 0.6) then {
			_can_revive_2 					= "soldierGB";				//array no.19
			_can_be_revived_2 				= "soldierGB";				//array no.21 
		};
	};
	case "GUER":{
		_can_revive 					= "soldierGB";		//array no.18 
		_can_revive_2 					= "";				//array no.19
		_can_revive_3					= "";				//array no.72 - NOT IMPLEMENTED
		_can_revive_4					= "";				//array no.73 - NOT IMPLEMENTED
		_can_be_revived 				= "soldierGB";		//array no.20  
		_can_be_revived_2 				= "";				//array no.21 
		_can_be_revived_3				= "";				//array no.74 - NOT IMPLEMENTED 
		_can_be_revived_4 				= "";				//array no.75 - NOT IMPLEMENTED
		_medic_1						= "G_medic_F";	//array no.76 - Used in conjunction with medpacks and bleeding	
		_medic_2						= "";				//array no.77 - Used in conjunction with medpacks and bleeding
		_medic_3						= "";				//array no.78 - NOT IMPLEMENTED	
		_medic_4						= "";				//array no.79 - NOT IMPLEMENTED	
		if ((resistance getFriend east) >= 0.6) then {
			_can_revive_2 					= "soldierEB";				//array no.19
			_can_be_revived_2 				= "soldierEB";				//array no.21 
		};
		if ((resistance getFriend west) >= 0.6) then {
			_can_revive_2 					= "soldierWB";				//array no.19
			_can_be_revived_2 				= "soldierWB";				//array no.21 
		};
		if ((resistance getFriend east) >= 0.6 && (resistance getFriend west) >= 0.6) then {
			_can_revive_2 					= "Soldier";				//array no.19
			_can_be_revived_2 				= "Soldier";				//array no.21 
		};
	};
};
//========================================================
// MEDPACK AND BLEEDING OPTIONS
if (isnil "norrn_revive_withmedpacks") then { norrn_revive_withmedpacks = 1 };
_medpacks						= norrn_revive_withmedpacks;				//array no.80 - Whether you want to give the units a limited number of revive kits 0/1 - no/yes
_stabilisation					= 0;				//array no.81 - NOT IMPLEMENTED
if (isnil "norrn_revive_withbleeding") then { norrn_revive_withbleeding = 1 };
_bleeding 						= norrn_revive_withbleeding;				//array no.82 - Make units bleed and require bandages
if (isnil "norrn_revive_medicpacks") then { norrn_revive_medicpacks = 0 };
_medic_medpacks 				= norrn_revive_medicpacks;				//array no.83 - No of medpacks for units specified in the _medic variables - they are required for reviving units		
if (isnil "norrn_revive_unitpacks") then { norrn_revive_unitpacks = 10 };
_unit_medpacks 					= norrn_revive_unitpacks;				//array no.84 - No of medpacks for units specified in the _can_revive variables - they are required for reviving units			
if (isnil "norrn_revive_medicbandage") then { norrn_revive_medicbandage = 0 };
_medic_bandages 				= norrn_revive_medicbandage;				//array no.85 - Bandages stop bleeding		
if (isnil "norrn_revive_unitbandage") then { norrn_revive_unitbandage = 10 };
_unit_bandages 					= norrn_revive_unitbandage;				//array no.86 - 
_medic_stable					= 0;				//array no.100 - NOT IMPLEMENTED
_unit_stable					= 0;				//array no.101 - NOT IMPLEMENTED
_stabTime_tillDeath				= 0;				//array no.87 - NOT IMPLEMENTED //Time until death following revive without stabilisation
// ==================================================================
// ENEMY SIDE TO PLAYABLE UNITS
_no_enemy_sides 				= 1;				//array no.22 - No of Enemy sides (0, 1 or 2). 
_enemy_side_1 					= "EAST";			//array no.23 - Enemy sides can be "EAST", "WEST", "GUER" etc  
_enemy_side_2 					= "";				//array no.24 
_enemy_side_3 					= "";				//array no.88 - NOT IMPLEMENTED
_enemy_side_4 					= "";				//array no.89 - NOT IMPLEMENTED
if ((west getFriend resistance) < 0.6) then {
	_no_enemy_sides 			= 2;				//array no.19
	_enemy_side_2 				= "RESISTANCE";				//array no.21 
};
switch (d_own_side) do {
	case "EAST":{
		_no_enemy_sides 				= 1;				//array no.22
		_enemy_side_1 					= "WEST";			//array no.23 - Enemy sides can be "EAST", "WEST", "GUER" etc  
		_enemy_side_2 					= "";				//array no.24 
		_enemy_side_3 					= "";				//array no.88 - NOT IMPLEMENTED
		_enemy_side_4 					= "";				//array no.89 - NOT IMPLEMENTED
		if ((east getFriend resistance) < 0.6) then {
			_no_enemy_sides 			= 2;				//array no.19
			_enemy_side_2 				= "RESISTANCE";				//array no.21 
		};
	};
	case "GUER":{
		_no_enemy_sides 				= 0;				//array no.22
		_enemy_side_1 					= "";			//array no.23 - Enemy sides can be "EAST", "WEST", "GUER" etc  
		_enemy_side_2 					= "";				//array no.24 
		_enemy_side_3 					= "";				//array no.88 - NOT IMPLEMENTED
		_enemy_side_4 					= "";				//array no.89 - NOT IMPLEMENTED
		if ((resistance getFriend east) < 0.6) then {
			_no_enemy_sides				= 1;				//array no.22
			_can_be_revived_2 			= "EAST";				//array no.21 
		};
		if ((resistance getFriend west) < 0.6) then {
			_no_enemy_sides 			= _no_enemy_sides + 1;				//array no.22
			if (_no_enemy_sides == 1) then {
				_enemy_side_1			= "WEST";			//array no.23 - Enemy sides can be "EAST", "WEST", "GUER" etc  
			} else{
				_enemy_side_2			= "WEST";			//array no.23 - Enemy sides can be "EAST", "WEST", "GUER" etc  
			};
		};
	};
};
// ==================================================================
// FRIENDLY SIDE TO PLAYABLE UNITS
_allied_side_1 					= "";			//array no.42 - Friendly sides can be "EAST", "WEST","RESISTANCE" etc.  
_allied_side_2 					= "";			//array no.43 - If all players are from the same side make sure you set the same side for both variables eg "WEST", "WEST"
_allied_side_3 					= "";				//array no.90 - NOT IMPLEMENTED
_allied_side_4 					= "";				//array no.91 - NOT IMPLEMENTED
switch (d_own_side) do {
	case "WEST":{
		_allied_side_1 					= "WEST";			//array no.42 - Friendly sides can be "EAST", "WEST","RESISTANCE" etc.  
		_allied_side_2 					= "";			//array no.43 - If all players are from the same side make sure you set the same side for both variables eg "WEST", "WEST"
		_allied_side_3 					= "";				//array no.90 - NOT IMPLEMENTED
		_allied_side_4 					= "";				//array no.91 - NOT IMPLEMENTED
		if ((west getFriend resistance) >= 0.6) then {
			_allied_side_2 				= "RESISTANCE";				//array no.43 
		};
	};
	case "EAST":{
		_allied_side_1 					= "EAST";			//array no.42 - Friendly sides can be "EAST", "WEST","RESISTANCE" etc.  
		_allied_side_2 					= "";			//array no.43 - If all players are from the same side make sure you set the same side for both variables eg "WEST", "WEST"
		_allied_side_3 					= "";				//array no.90 - NOT IMPLEMENTED
		_allied_side_4 					= "";				//array no.91 - NOT IMPLEMENTED
		if ((east getFriend resistance) >= 0.6) then {
			_allied_side_2 				= "RESISTANCE";				//array no.43 
		};
	};
	case "GUER":{
		_allied_side_1 					= "RESISTANCE";			//array no.42 - Friendly sides can be "EAST", "WEST","RESISTANCE" etc.  
		_allied_side_2 					= "";			//array no.43 - If all players are from the same side make sure you set the same side for both variables eg "WEST", "WEST"
		_allied_side_3 					= "";				//array no.90 - NOT IMPLEMENTED
		_allied_side_4 					= "";				//array no.91 - NOT IMPLEMENTED
		if ((resistance getFriend east) >= 0.6) then {
			_allied_side_2 					= "EAST";				//array no.43
		};
		if ((resistance getFriend west) >= 0.6) then {
			_allied_side_2 					= "WEST";				//array no.43
		};
	};
};
// ==================================================================
// UNCONSCIOUS CAMERA OPTIONS
if (isnil "norrn_revive_withfollowcam") then { norrn_revive_withfollowcam = 0 };
_follow_cam 					= norrn_revive_withfollowcam;				//array no.5  - option to allow viewing of friendly units while unconscious
if (isnil "norrn_revive_distancecam") then { norrn_revive_distancecam = 250 };
_follow_cam_distance			= norrn_revive_distancecam;				//array no.32 - the range that unconscious players can spectate friendly units
_follow_cam_team	   			= 1;				//array no.44 - set to 1 if you wish unconscious players only to spectate players within (call XfPlayableUnitsVars) array
_top_view_height 	   			= 0;				//array no.55 - allows you to set the top down camera height 
_visible_timer 					= 1;				//array no.41 - view a cound-down timer while unconscious
_unconscious_music 				= 0;				//array no.46 - music must appear as unc_theme in music.hpp
// ==================================================================
// RESPAWN DIALOG OPTIONS
_nearest_teammate_dialog 		= 0;				//array no.3  - whether a respawn dialog appears when there are no players within this distance  
if (isnil "norrn_revive_alldeaddiag") then { norrn_revive_alldeaddiag = 0 };
_all_dead_dialog 				= norrn_revive_alldeaddiag;				//array no.1  - whether a respawn dialog appears when all players are unconscious (_all_dead_player = 1)  
if (isnil "norrn_revive_buttonstimer") then { norrn_revive_buttonstimer = 30 };
_respawn_button_timer 			= norrn_revive_buttonstimer;				//array no.25 - Time until respawn button appears (0 = approx. 12 seconds), NB: Set to a high number like 100000 seconds if you do not want
if (isnil "norrn_revive_distancefriend") then { norrn_revive_distancefriend = 250 };
_distance_to_friend 			= norrn_revive_distancefriend;				//array no.26 - If the closest friendly unit is further than this distance away trigger respawn dialog 
_all_dead_player 				= 0;				//array no.56
_all_dead_distance 				= 10000;			//array no.57 - whether a respawn dialog appears when all players within a specified distance are unconscious (_all_dead_player = 1)
// ==================================================================
// Bonus life for aiding team mates function
_reward_function 				= 0; 				//array no.96 - specify whether a unit receives bonus lives for reviving other players
_revives_required 				= 1;				//array no.97 - Number of revives required before recieving a bonus life
// ==================================================================
// Team kill function
_team_kill_function 			= 0;    			//array no.98 - specify whether a unit loses a life for killing team mates
_no_team_kills 					= 1;				//array no.99 - Number of teamkills before punishment
// ==================================================================
// CONFIGURABLE OPTIONS FOR HEAL YOURSELF FUNCTION
if (isnil "norrn_revive_withselfheal") then { norrn_revive_withselfheal = 1 };
_heal_yourself 					= norrn_revive_withselfheal;				//array no.8  - whether a unit can heal damage to itself
if (isnil "norrn_revive_amountselfheal") then { norrn_revive_amountselfheal = 10 };
_no_of_heals 					= norrn_revive_amountselfheal;				//array no.29 - Number of heals that each player gets during a mission  
_lower_bound_heal 				= 0.01;				//array no.30 - The damage level range between which the heal action becomes available 
_upper_bound_heal 				= 0.9;				//array no.31
// ==================================================================
// AI REVIVE BEHAVIOUR OPTIONS
_goto_revive 					= 0;				//array no. 9  - closest AI automatically moves to revive a downed team mate
_AI_smoke 						= 1;				//array no. 40 - if available reviving AI throws smoke on downed AI position
_AI_aware 						= 1;				//array no. 49 - AI will clear an enemy units it is aware of before auto reviving
_AI_cover 						= 1;				//array no. 50 - second AI unit moves with AI reviver to give cover
_AI_dismount 					= 1;				//array no. 58 - toggles ability of reviving AI units to dismount vehicles (1 = dismount)
_call_for_AI_help 				= 1;				//array no. 59 - allows AI units to call for help 
_goto_revive_distance 			= 500;				//array no. 33 - distance AI units will move to revive a downed team mate


// ==================================================================
// OPTIONS FOR PLAYER'S DEAD BODIES AND EQUIPMENT - Additional revive functions with many thanks to alef (0 - off, 1 - on except for _bury_timeout)
if (isnil "norrn_revive_dropweapons") then { norrn_revive_dropweapons = 0 };
_drop_weapons 					= norrn_revive_dropweapons; 				//array no.93  - should the respawned player drop his weapons where he died?
_cadaver 						= 0; 				//array no.94 - should the respawned player's body remain there?
_bury_timeout 					= 15;				//array no.95 - if drop weapons OR player body, how long before the body is buried?
													// 0=maximum (1200s) , n=seconds up to 1200s (hard coded)
// ==================================================================
// USER CODE - eg. NORRNCustonexec1="execvm ""myscript.sqf"";hint ""myoutput"";"
NORRNCustomExec1				=""; 				// Exec1 occurs following being revived
NORRNCustomExec2				="";  				// Exec2 occurs when you team kill
NORRNCustomExec3				="";  				// Exec3 occurs when you spawn at base
NORRNCustomExec4				="";  				// Exec4 occurs when you try and spawn at base but it is still occupied
NORRNCustomExec5				="";  				// Must use variables: MAP_r_rejoin (false - first time, 
													// true - rejoining the server, and 
													// MAP_r_no_lives - number of lives if you rejoin server) 
// =====================================================================================================================
// DO NOT MODIFY THE FOLLOWING CODE
// =====================================================================================================================
NORRN_revive_array = [];
NORRN_revive_array = [_mission_end_function,_all_dead_dialog,_JIP_spawn_dialog,_nearest_teammate_dialog,_unconscious_markers,_follow_cam,_call_out_function,_revive_timer,
_heal_yourself,_goto_revive,-1,_respawn_at_base_addWeapons,_no_respawn_points,_Base_1,_Base_2,_Base_3,_Base_4,_time_b4_JIP_spawn_dialog,
_can_revive,_can_revive_2,_can_be_revived,_can_be_revived_2,_no_enemy_sides,_enemy_side_1,_enemy_side_2,_respawn_button_timer,_distance_to_friend,
_revive_time_limit,_respawn_position,_no_of_heals,_lower_bound_heal,_upper_bound_heal,_follow_cam_distance,_goto_revive_distance,_respawn_at_base_magazines,
_respawn_at_base_weapons, _Base_free_respawn, _revive_damage, _max_respawns, _unconscious_drag,_AI_smoke,_visible_timer,_allied_side_1,_allied_side_2,_follow_cam_team,
_water_dialog, _unconscious_music, -1, -1, _AI_aware,_AI_cover,_mobile_spawn,"",_mobile_man,_altUnc_animation,_top_view_height,
_all_dead_player,_all_dead_distance,_AI_dismount,_call_for_AI_help,_mobile_type,_load_wounded,_perpetual_server,_JIP_respawns,_caseVAC,_mediVAC,_chance_ofDeath,_dualTimer,
_respawnAtBaseWait,_objectiveBasedRP,_mobile_base2_start,_mobile_man2,_can_revive_3,_can_revive_4,_can_be_revived_3,_can_be_revived_4,_medic_1,_medic_2,_medic_3,_medic_4,
_medpacks,_stabilisation,_bleeding,_medic_medpacks,_unit_medpacks,_medic_bandages,_unit_bandages,_stabTime_tillDeath,_enemy_side_3,_enemy_side_4,
_allied_side_3,_allied_side_4,_deadSpectator_cam,_drop_weapons,_cadaver,_bury_timeout,_reward_function,_revives_required,_team_kill_function,_no_team_kills,_medic_stable, _unit_stable];

// start related revive functions
[] execVM "base\support\modules\norrn_revive\init_related_scripts.sqf";

if (true) exitWith {};	
